from pydantic import BaseModel

from schema.user import IUserRead


class IGetTypeAddress(BaseModel):
    id: int
    name: str

    class Config:
        from_attributes = True


class AddressList(BaseModel):
    path: str
    id: int
    latitude: str
    longitude: str

    class Config:
        from_attributes = True


class IAddressListPost(BaseModel):
    path: str
    latitude: str
    longitude: str
    id_type_address: int

    class Config:
        from_attributes = True
class IAddressListPut(BaseModel):
    path: str | None
    latitude: str | None
    longitude: str | None
    id_type_address: int | None

    class Config:
        from_attributes = True

class IAddressListRead(AddressList, BaseModel):
    type_address: IGetTypeAddress

    class Config:
        from_attributes = True


class IRespawnCourierRead(BaseModel):
    id: int
    user: IUserRead
    address: AddressList

    class Config:
        from_attributes = True
